package com.ponhu.ea2.enums;

/**
 * 商品销售模式枚举
 * @author zhaokai
 */
public enum SalesModelEnum {

    NORMAL(1, "以采定销"),
    JIT(2, "以销定采"),
    ;

    private Integer code;

    private String name;

    SalesModelEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getName(Integer code){
        if(NORMAL.code.equals(code)){
            return NORMAL.name;
        }
        if(JIT.code.equals(code)){
            return JIT.name;
        }
        return "未找到相应枚举数据";
    }
}
